home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / find.z / find
Encoding:
Text File  |  2002-10-03  |  14.0 KB  |  265 lines

  1.  
  2.  
  3.  
  4. ffffiiiinnnndddd((((1111))))                                                                ffffiiiinnnndddd((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      find - find files
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ffffiiiinnnndddd path-name-list [ expression ]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _f_i_n_d recursively descends the directory hierarchy for each pathname in
  16.      the _p_a_t_h-_n_a_m_e-_l_i_s_t (that is, one or more pathnames) seeking files that
  17.      match a boolean _e_x_p_r_e_s_s_i_o_n written in the primaries given below.  If the
  18.      expression does not contain at least one of ----pppprrrriiiinnnntttt, ----ooookkkk, or ----eeeexxxxeeeecccc,
  19.      including the case of a null expression, a ----pppprrrriiiinnnntttt is implicit.  In the
  20.      descriptions, the argument _n is used as a decimal integer where ++++_n means
  21.      more than _n, ----_n means less than _n, and _n means exactly _n.  Valid
  22.      expressions are:
  23.  
  24.      ----nnnnaaaammmmeeee _f_i_l_e       True if _f_i_l_e matches the current filename.  Normal shell
  25.                       argument syntax can be used if escaped (watch out for [[[[,
  26.                       ????, and ****).
  27.  
  28.      ----ppppeeeerrrrmmmm [----]_m_o_d_e    True if the file permission flags exactly match the file
  29.                       mode given by _m_o_d_e which can be an octal number or a
  30.                       symbolic expression of the form used in _c_h_m_o_d(1)).  If
  31.                       _m_o_d_e is prefixed by a minus sign, only the bits that are
  32.                       set in _m_o_d_e are compared with the file permission flags,
  33.                       and the expression evaluates true if they match.
  34.  
  35.      ----ttttyyyyppppeeee _c          True if the type of the file is _c, where _c is bbbb, cccc, dddd,
  36.                       llll, pppp, ffff, or ssss for block special file, character special
  37.                       file, directory, symbolic link, fifo (a.k.a named pipe),
  38.                       plain file, or socket respectively.
  39.  
  40.      ----lllliiiinnnnkkkkssss _n         True if the file has _n links.
  41.  
  42.      ----uuuusssseeeerrrr _u_n_a_m_e      True if the file belongs to the user _u_n_a_m_e.  If _u_n_a_m_e is
  43.                       numeric and does not appear as a login name in the
  44.                       /_e_t_c/_p_a_s_s_w_d file, it is taken as a user ID.
  45.  
  46.      ----nnnnoooouuuusssseeeerrrr          True if the file belongs to a user not in the
  47.                       /_e_t_c/_p_a_s_s_w_d file.
  48.  
  49.      ----ggggrrrroooouuuupppp _g_n_a_m_e     True if the file belongs to the group _g_n_a_m_e.  If _g_n_a_m_e
  50.                       is numeric and does not appear in the /_e_t_c/_g_r_o_u_p file,
  51.                       it is taken as a group ID.
  52.  
  53.      ----nnnnooooggggrrrroooouuuupppp         True if the file belongs to a group not in the
  54.                       /_e_t_c/_g_r_o_u_p file.
  55.  
  56.      ----pppprrrroooojjjj _p_r_o_j_n_a_m_e   True if the file has a project ID of _p_r_o_j_n_a_m_e.  If
  57.                       _p_r_o_j_n_a_m_e is numeric and does not appear in the
  58.                       /_e_t_c/_p_r_o_j_i_d file, it is taken as a project ID.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffiiiinnnndddd((((1111))))                                                                ffffiiiinnnndddd((((1111))))
  71.  
  72.  
  73.  
  74.      ----nnnnoooopppprrrroooojjjj          True if the file has a project ID not in the /_e_t_c/_p_r_o_j_i_d
  75.                       file.
  76.  
  77.      ----ssssiiiizzzzeeee [++++----]n[cccc]   True if the file is _n blocks long (512 bytes per block).
  78.                       If _n is followed by a cccc, the size is in characters.
  79.  
  80.      ----iiiinnnnuuuummmm _n          True if _n is the inode number of the file.
  81.  
  82.      ----aaaattttiiiimmmmeeee [++++----]_n     True if the file was accessed _n days ago.  The
  83.                       definition of _n days ago is any time within the interval
  84.                       beginning exactly _n*24 hours ago and ending exactly
  85.                       (_n-1)*24 hours ago.  The ++++ and ---- prefixes signify more
  86.                       or less than _n days ago, respectively, thus ++++_n means
  87.                       more than _n*24 hours ago, and ----_n means less than _n*24
  88.                       hours ago.  (See _s_t_a_t(2) for a description of which file
  89.                       operations change the access time of a file.)  The
  90.                       access time of directories in _p_a_t_h-_n_a_m_e-_l_i_s_t is changed
  91.                       by _f_i_n_d itself.
  92.  
  93.      ----mmmmttttiiiimmmmeeee [++++----]_n     True if the file was modified _n days ago.  See ----aaaattttiiiimmmmeeee
  94.                       for definition of "_n days ago".  (See _s_t_a_t(2) for a
  95.                       description of which file operations change the
  96.                       modification time of a file.)
  97.  
  98.      ----ccccttttiiiimmmmeeee [++++----]_n     True if the file was changed _n days ago.  See ----aaaattttiiiimmmmeeee for
  99.                       definition of "_n days ago".  (See _s_t_a_t(2) for a
  100.                       description of which file operations change the change
  101.                       time of a file.)
  102.  
  103.      ----eeeexxxxeeeecccc _c_m_d        True if the executed _c_m_d returns a zero value as exit
  104.                       status.  The end of _c_m_d must be punctuated by an escaped
  105.                       semicolon.  A command argument {{{{}}}} is replaced by the
  106.                       current pathname.
  107.  
  108.      ----ooookkkk _c_m_d          Like ----eeeexxxxeeeecccc except that the generated command line is
  109.                       printed with a question mark first, and is executed only
  110.                       if the user responds by typing yyyy.
  111.  
  112.      ----pppprrrriiiinnnntttt           Always true; causes the current pathname to be printed.
  113.  
  114.      ----ccccppppiiiioooo _d_e_v_i_c_e     Always true; write the current file on _d_e_v_i_c_e in _c_p_i_o(1)
  115.                       format (5120-byte records).  ffffiiiinnnndddd ----ccccppppiiiioooo issues a warning
  116.                       if it encounters a file larger than two gigabytes.
  117.                       _c_p_i_o(1) must be used to archive files of this size.
  118.  
  119.      ----nnnnccccppppiiiioooo _d_e_v_i_c_e    same as _----_cccc_pppp_iiii_oooo option except archive is written in the
  120.                       _cccc_pppp_iiii_oooo _----_cccc format.
  121.  
  122.      ----nnnneeeewwwweeeerrrr _f_i_l_e      True if the current file has been modified more recently
  123.                       than the argument _f_i_l_e (see _s_t_a_t(2) for a description of
  124.                       which file operations change the modification time of a
  125.                       file).
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ffffiiiinnnndddd((((1111))))                                                                ffffiiiinnnndddd((((1111))))
  137.  
  138.  
  139.  
  140.      ----aaaannnneeeewwwweeeerrrr _f_i_l_e     True if current file has been accessed more recently
  141.                       than the argument _f_i_l_e (see _s_t_a_t(2) for a description of
  142.                       which file operations change the access time of a file).
  143.  
  144.      ----ccccnnnneeeewwwweeeerrrr _f_i_l_e     True if current file has been changed more recently than
  145.                       the argument _f_i_l_e (see _s_t_a_t(2) for a description of
  146.                       which file operations change the change time of a file).
  147.  
  148.      ----ddddeeeepppptttthhhh           Always true; causes descent of the directory hierarchy
  149.                       to be done so that all entries in a directory are acted
  150.                       on before the directory itself.  This can be useful when
  151.                       _f_i_n_d is used with _c_p_i_o(1) to transfer files that are
  152.                       contained in directories without write permission.
  153.  
  154.      ----pppprrrruuuunnnneeee           Always true; do not examine any directories or files in
  155.                       the directory structure below the _p_a_t_t_e_r_n just matched.
  156.                       If the current pathname is a directory, _f_i_n_d does not
  157.                       descend into that directory, provided ----ddddeeeepppptttthhhh is not also
  158.                       used.
  159.  
  160.      ----mmmmoooouuuunnnntttt           Always true; restricts the search to the filesystem
  161.                       containing the current element of the _p_a_t_h-_n_a_m_e-_l_i_s_t.
  162.  
  163.      ----ffffssssttttyyyyppppeeee _t_y_p_e     True if the filesystem to which the file belongs is of
  164.                       type _t_y_p_e.
  165.  
  166.      ----llllooooccccaaaallll           True if the file physically resides on the local system;
  167.                       causes the search not to descend into remotely mounted
  168.                       filesystems.
  169.  
  170.      ----ffffoooolllllllloooowwww          Always true; causes the underlying file of a symbolic
  171.                       link to be checked rather than the symbolic link itself.
  172.  
  173.      ----llllaaaabbbbeeeellll _l_a_b_e_l     True if the file label and _l_a_b_e_l satisfy the _m_a_c__e_q_u_a_l
  174.                       label equality relationship.  See _d_o_m_i_n_a_n_c_e(5).
  175.  
  176.      ----xxxxllllaaaabbbbeeeellll _l_a_b_e_l    True if the file label is exactly identical to _l_a_b_e_l.
  177.                       See _d_o_m_i_n_a_n_c_e(5).
  178.  
  179.      ----ddddoooommmmiiiinnnnaaaatttteeeessss _l_a_b_e_l True if the file label dominates _l_a_b_e_l.  See
  180.                       _d_o_m_i_n_a_n_c_e(5).
  181.  
  182.      ----ddddoooommmmiiiinnnnaaaatttteeeedddd _l_a_b_e_l True if the file label is dominated by _l_a_b_e_l.  See
  183.                       _d_o_m_i_n_a_n_c_e(5).
  184.  
  185.      \\\\(((( _e_x_p_r_e_s_s_i_o_n \\\\)))) True if the parenthesized expression is true
  186.                       (parentheses are special to the shell and must be
  187.                       escaped).
  188.  
  189.      The primaries can be combined using the following operators (in order of
  190.      decreasing precedence):
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ffffiiiinnnndddd((((1111))))                                                                ffffiiiinnnndddd((((1111))))
  203.  
  204.  
  205.  
  206.      +o  The negation of a primary (!!!! is the unary nnnnooootttt operator).
  207.  
  208.      +o  Concatenation of primaries (the aaaannnndddd operation is implied by the
  209.         juxtaposition of two primaries).
  210.  
  211.      +o  Alternation of primaries (----oooo is the oooorrrr operator).
  212.  
  213. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  214.      To remove all files named _a._o_u_t or *._o that have not been accessed for a
  215.      week:
  216.  
  217.           _ffff_iiii_nnnn_dddd _//// _\\\\_(((( _----_nnnn_aaaa_mmmm_eeee _aaaa_...._oooo_uuuu_tttt _----_oooo _----_nnnn_aaaa_mmmm_eeee _''''_****_...._oooo_'''' _\\\\_)))) _----_aaaa_tttt_iiii_mmmm_eeee _++++_7777 _----_eeee_xxxx_eeee_cccc _rrrr_mmmm _{{{{_}}}} _\\\\_;;;;
  218.  
  219.      To display all character special devices on the root filesystem except
  220.      those under any _d_e_v directory:
  221.  
  222.           _ffff_iiii_nnnn_dddd _//// _----_mmmm_oooo_uuuu_nnnn_tttt _\\\\_(((( _----_tttt_yyyy_pppp_eeee _dddd _----_nnnn_aaaa_mmmm_eeee _dddd_eeee_vvvv _----_pppp_rrrr_uuuu_nnnn_eeee _\\\\_)))) _----_oooo _----_tttt_yyyy_pppp_eeee _cccc _----_pppp_rrrr_iiii_nnnn_tttt
  223.  
  224.  
  225. FFFFIIIILLLLEEEESSSS
  226.      /etc/passwd   UID information supplier
  227.      /etc/group    GID information supplier
  228.      /etc/projid   Project ID information supplier
  229.  
  230. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  231.      chmod(1), cpio(1), sh(1), test(1), stat(2), umask(2), efs(4), xfs(4),
  232.      dominance(5).
  233.  
  234. BBBBUUUUGGGGSSSS
  235.      ffffiiiinnnndddd //// ----ddddeeeepppptttthhhh always fails with the message:
  236.  
  237.           find:  stat failed:  : No such file or directory
  238.  
  239.      _f_i_n_d relies on a completely correct directory hierarchy for its search.
  240.      In particular, if a directory's '..' is missing or incorrect, _f_i_n_d fails
  241.      at that point and issue some number of these messages:
  242.  
  243.           stat failed:
  244.  
  245.      ----ddddeeeepppptttthhhh and ----pppprrrruuuunnnneeee do not work together well.
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.